# coding: utf-8
from sqlalchemy import Column, Date, DateTime, Float, String, Table, Text
from sqlalchemy.dialects.mysql import INTEGER, TINYINT
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()
metadata = Base.metadata


class PageDvpuintproj1(Base):
    __tablename__ = 'page_dvpuintproj_1'

    user_id = Column(String(255), primary_key=True, nullable=False)
    proj_id = Column(String(255), primary_key=True, nullable=False)
    data = Column(String(5000))
    remark = Column(String(255))


class TbDvpunitbaisc(Base):
    __tablename__ = 'tb_dvpunitbaisc'
    __table_args__ = {'comment': '开发单元基本信息表'}

    DvpUnit_ID = Column(String(30),primary_key=True,nullable=False,comment='开发单元ID')
    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Belong_DvpUnit_Name = Column(String(30), comment='隶属开发单元名称')
    DvpUnit_Rank = Column(String(30), comment='开发单元级别')
    Remark = Column(String(200), comment='备注')


class TbOilwellStimulateResultForcasNnProjInputDb(Base):
    __tablename__ = 'tb_oilwell_stimulate_result_forcas_nn__proj_input_db'
    __table_args__ = {'comment': '油井措施效果神经网络法预测模型训练样本输入数据表'}

    Well_ID = Column(String(30), primary_key=True, comment='井号ID')
    Proj_Stimulate_Date = Column(Date, comment='方案时间')
    Parameter_ID = Column(String(50), comment='参数ID')
    Parameter_Value = Column(Float(30, True), comment='参数值')


class TbOilwellStimulateResultForcasNnProjOutputDb(Base):
    __tablename__ = 'tb_oilwell_stimulate_result_forcas_nn__proj_output_db'
    __table_args__ = {'comment': '油井措施效果神经网络法预测模型训练样本输入数据表'}

    Well_ID = Column(String(30), primary_key=True, comment='井号ID')
    Proj_Stimulate_Date = Column(Date, comment='方案时间')
    Parameter_ID = Column(String(50), comment='参数ID')
    Parameter_Value = Column(Float(30, True), comment='参数值')


class TbOilwellStimulateResultForcasNnChecksamplesInputDb(Base):
    __tablename__ = 'tb_oilwell_stimulate_result_forcas_nn_checksamples_input_db'
    __table_args__ = {'comment': '油井措施效果神经网络法预测模型训练样本输入数据表'}

    Well_ID = Column(String(30), primary_key=True, comment='井号ID')
    Stimulate_Date = Column(Date, comment='完井日期')
    Sample_IsTrain = Column(TINYINT(4), comment='选中训练;1表示选中；0表示未选中')
    Parameter_ID = Column(String(50), comment='参数ID')
    Parameter_Value = Column(Float(30, True), comment='参数值')


class TbOilwellStimulateResultForcasNnChecksamplesOutputDb(Base):
    __tablename__ = 'tb_oilwell_stimulate_result_forcas_nn_checksamples_output_db'
    __table_args__ = {'comment': '油井措施效果神经网络法预测模型训练样本输入数据表'}

    Well_ID = Column(String(30), primary_key=True, comment='井号ID')
    Stimulate_Date = Column(Date, comment='完井日期')
    Sample_IsTrain = Column(TINYINT(4), comment='选中训练;1表示选中；0表示未选中')
    Parameter_ID = Column(String(50), comment='参数ID')
    Parameter_Value = Column(Float(30, True), comment='参数值')


class TbOilwellStimulateResultForcasNnInputParameter(Base):
    __tablename__ = 'tb_oilwell_stimulate_result_forcas_nn_input_parameters'
    __table_args__ = {'comment': '油井措施效果神经网络法预测模型输入参数集表'}

    NN_Model_ID = Column(String(50),primary_key=True,nullable=False,comment='模型ID')
    NN_Model_Input_Parameters_ID = Column(String(50),primary_key=True,nullable=False,comment='输入参数集ID')
    Parameter_ID = Column(String(50),primary_key=True,nullable=False,comment='参数ID')
    Parameter_Name = Column(String(50), comment='参数名称')
    Parameter_UOM_Name = Column(String(50), comment='参数计量单位')
    Parameter_IsTrain = Column(INTEGER(11), comment='选中训练；1表示选中；0表示未选中')
    Remark = Column(String(200), comment='备注')


class TbOilwellStimulateResultForcasNnModel(Base):
    __tablename__ = 'tb_oilwell_stimulate_result_forcas_nn_model'
    __table_args__ = {'comment': '油井措施效果神经网络法预测模型表'}

    NN_Model_ID = Column(String(50),primary_key=True,nullable=False,comment='模型ID')
    NN_Model_Name = Column(String(50),primary_key=True,nullable=False,comment='模型名称')
    Stimulate_Type_ID = Column(String(50),primary_key=True,nullable=False,comment='措施类别ID')
    NN_Model_Input_Parameters_ID = Column(String(50), comment='输入参数集ID')
    NN_Model_Output_Parameters_ID = Column(String(50), comment='预测参数集ID')
    NN_Model_TrainSamples_ID = Column(String(50), comment='训练样本集ID')
    NN_Model_TrainCheckSamples_ID = Column(String(50), comment='检验样本集ID')
    NN_Model_Description = Column(String(50), comment='模型简述')
    Create_DateTime = Column(DateTime, comment='创建时间')
    Train_DateTime = Column(DateTime, comment='训练时间')
    OPT_DateTime = Column(DateTime, comment='优化时间')
    Remark = Column(String(200), comment='备注')


class TbOilwellStimulateResultForcasNnModelBelongDevunit(Base):
    __tablename__ = 'tb_oilwell_stimulate_result_forcas_nn_model_belong_devunit'
    __table_args__ = {'comment': '油井措施效果神经网络法预测模型适用开发单元关系表'}

    NN_Model_ID = Column(String(50),primary_key=True,nullable=False,comment='模型ID')
    DvpUnit_ID = Column(String(50),primary_key=True,nullable=False,comment='开发单元ID')


class TbOilwellStimulateResultForcasNnOutputParameter(Base):
    __tablename__ = 'tb_oilwell_stimulate_result_forcas_nn_output_parameters'
    __table_args__ = {'comment': '油井措施效果神经网络法预测模型输出参数集表'}

    NN_Model_ID = Column(String(50),primary_key=True,nullable=False,comment='模型ID')
    NN_Model_Output_Parameters_ID = Column(String(50),primary_key=True,nullable=False,comment='输出参数集ID')
    Parameter_ID = Column(String(50),primary_key=True,nullable=False,comment='参数ID')
    Parameter_Name = Column(String(50), comment='参数名称')
    Parameter_UOM_Name = Column(String(50), comment='参数计量单位')
    Decimal_Digits = Column(INTEGER(11), comment='小数位数')
    Parameter_IsTrain = Column(INTEGER(11), comment='选中训练；1表示选中；0表示未选中')
    Remark = Column(String(200), comment='备注')


class TbOilwellStimulateResultForcasNnTrainsamplesInputDb(Base):
    __tablename__ = 'tb_oilwell_stimulate_result_forcas_nn_trainsamples_input_db'
    __table_args__ = {'comment': '油井措施效果神经网络法预测模型训练样本输入数据表'}

    Well_ID = Column(String(30), primary_key=True, comment='井号ID')
    Stimulate_Date = Column(Date, comment='完井日期')
    Sample_IsTrain = Column(TINYINT(4), comment='选中训练;1表示选中；0表示未选中')
    Parameter_ID = Column(String(50), comment='参数ID')
    Parameter_Value = Column(Float(30, True), comment='参数值')


class TbOilwellStimulateResultForcasNnTrainsamplesOutputDb(Base):
    __tablename__ = 'tb_oilwell_stimulate_result_forcas_nn_trainsamples_output_db'
    __table_args__ = {'comment': '油井措施效果神经网络法预测模型训练样本输入数据表'}

    Well_ID = Column(String(30), primary_key=True, comment='井号ID')
    Stimulate_Date = Column(Date, comment='完井日期')
    Sample_IsTrain = Column(TINYINT(4), comment='选中训练;1表示选中；0表示未选中')
    Parameter_ID = Column(String(50), comment='参数ID')
    Parameter_Value = Column(Float(30, True), comment='参数值')


# t_tb_oilwellstim_evaluate_result = Table(
#     'tb_oilwellstim_evaluate_result', metadata,
#     Column('Well_Name', String(30), comment='井号'),
#     Column('Stim_Date', DateTime, comment='措施日期'),
#     Column('StimType_Name', String(30), comment='措施类别'),
#     Column('Stim_ValidPeriod', INTEGER(11), comment='有效期'),
#     Column('Stim_IncreOil', Float(30, True), comment='措施增油量'),
#     Column('StimCost', Float(30, True), comment='作业成本'),
#     Column('StimOil_OprCost', Float(30, True), comment='增油操作成本'),
#     Column('StimOil_CommodityRatio', Float(30, True), comment='原油商品率'),
#     Column('StimOil_Gross_Sales Income', Float(30, True), comment='销售毛收入'),
#     Column('StimOil_Total_TaxRatio', Float(30, True), comment='销售总税费'),
#     Column('StimOil_Static_ Gains', Float(30, True), comment='静态收益'),
#     Column('StimOil_NPV', Float(30, True), comment='财务净现值'),
#     Column('StimOil_ROI', Float(30, True), comment='投资利润率'),
#     Column('StimOil_NPVR', Float(30, True), comment='财务净现值率'),
#     Column('StimOil_FIRR', Float(30, True), comment='财务内部收益率'),
#     Column('Stim _IncreOil_Critical', Float(30, True), comment='临界增油量'),
#     Column('StimOil_Price_Critical', Float(30, True), comment='增油经济临界油价'),
#     Column('Remark', String(200), comment='备注'),
#     comment='油井措施经济评价结果表'
# )


class Tb_OilWellStimEvaluateResult(Base):
    __tablename__ = 'tb_oilwellstim_evaluate_result'
    __table_args__ = {'comment': '油井措施经济评价结果表'}

    Well_Name = Column(String(30), primary_key=True, comment='井号')
    Stim_Date = Column(Date, primary_key=True, comment='措施日期')
    StimType_Name = Column(String(30), primary_key=True, comment='措施类别')
    Stim_ValidPeriod = Column(INTEGER(11), comment='有效期')
    Stim_IncreOil = Column(Float(30), comment='措施增油量')
    StimCost = Column(Float(30), comment='作业成本')
    StimOil_WellOprCost = Column(Float(30), comment='增油操作成本')
    StimOil_CommodityRatio = Column(Float(30), comment='原油商品率')
    StimOil_Gross_SalesIncome = Column(Float(30), comment='销售毛收入')
    StimOil_Total_Tax = Column(Float(30), comment='销售税费率')
    StimOil_Static_Gains = Column(Float(30), comment='静态收益')
    StimOil_NPV = Column(Float(30), comment='财务净现值')
    StimOil_ROI = Column(Float(30), comment='投资利润率')
    StimOil_NPVR = Column(Float(30), comment='财务净现值率')
    StimOil_FIRR = Column(Float(30), comment='财务内部收益率')
    Stim_IncreOil_Critical = Column(Float(30), comment='临界增油量')
    StimOil_Price_Critical = Column(Float(30), comment='增油经济临界油价')
    Oil_Price = Column(Float(30), comment='原油价格')
    OilSale_TotalTaxRatio = Column(Float(30), comment='销售总税费')
    Money_Discount = Column(Float(30), comment='资金贴现率')
    Oil_OprCost = Column(Float(30), comment='操作吨油成本')
    Remark = Column(String(200), comment='备注')


class TbOilwellstimPlanprojEvaluateResult(Base):
    __tablename__ = 'tb_oilwellstim_planproj_evaluate_result'
    __table_args__ = {'comment': '油井措施方案经济评价结果表'}

    DvpUnit_OilStim_PlanProj_Name = Column(String(30), primary_key=True, nullable=False, comment='规划方案')
    Well_Name = Column(String(30),primary_key=True,nullable=False,comment='井号')
    Year = Column(String(10), primary_key=True, nullable=False, comment='规划年度')
    StimType_Name = Column(String(30),primary_key=True,nullable=False,comment='措施类别')
    Stim_ValidPeriod = Column(INTEGER(11), comment='有效期')
    Stim_IncreOil = Column(Float(20, True), comment='措施增油量')
    StimOil_CommodityRatio = Column(Float(20, True), comment='原油商品率')
    Oil_Price = Column(Float(20, True), comment='原油价格')
    OilSale_TotalTaxRatio = Column(Float(20, True), comment='销售税费率')
    Money_Discount = Column(Float(20, True), comment='资金贴现率')
    Oil_OprCost = Column(Float(20, True), comment='操作吨油成本')
    StimCost = Column(Float(20, True), comment='作业成本')
    StimOil_WellOprCost = Column(Float(20, True), comment='增油操作成本')
    StimOil_Total_Tax = Column(Float(20, True), comment='销售总税费')
    StimOil_Gross_SalesIncome = Column(Float(20, True), comment='销售毛收入')
    StimOil_Static_Gains = Column(Float(20, True), comment='静态收益')
    StimOil_NPV = Column(Float(20, True), comment='财务净现值')
    StimOil_ROI = Column(Float(20, True), comment='投资利润率')
    StimOil_NPVR = Column(Float(20, True), comment='财务净现值率')
    StimOil_FIRR = Column(Float(20, True), comment='财务内部收益率')
    Stim_IncreOil_Critical = Column(Float(20, True), comment='临界增油量')
    StimOil_Price_Critical = Column(Float(20, True), comment='增油经济临界油价')
    Remark = Column(String(200), comment='备注')


class TbOilwellstimPlanprojForecast(Base):
    __tablename__ = 'tb_oilwellstim_planproj_forecast'
    __table_args__ = {'comment': '油井措施方案效果预测表'}

    DvpUnit_OilStim_PlanProj_Name = Column(String(30),primary_key=True,nullable=False,comment='规划方案')
    Well_Name = Column(String(30),primary_key=True,nullable=False,comment='井号')
    Year = Column(String(10), primary_key=True, nullable=False, comment='规划年度')
    StimType_Name = Column(String(30),primary_key=True,nullable=False,comment='措施类别')
    Forecast_Method = Column(String(100), comment='预测方法')
    Stim_ValidPeriod = Column(INTEGER(11), comment='有效期')
    Stim_IncreOil = Column(Float(20, True), comment='措施增油量')
    Update_Date = Column(DateTime, comment='更新时间')
    Remark = Column(String(200), comment='备注')


class TbOilwellstimResult(Base):
    __tablename__ = 'tb_oilwellstim_result'
    __table_args__ = {'comment': '油井措施效果记录表'}

    Well_Name = Column(String(30),primary_key=True,nullable=False,comment='井号')
    Stim_Date = Column(Date, primary_key=True, nullable=False, comment='措施日期')
    StimType_Name = Column(String(30),primary_key=True,nullable=False,comment='措施类别')
    Stim_ValidPeriod = Column(INTEGER(11), comment='有效期')
    Stim_IncreOil = Column(Float(30, True), comment='措施增油量')
    Remark = Column(String(200), comment='备注')


class TbOilwellstimType(Base):
    __tablename__ = 'tb_oilwellstim_type'
    __table_args__ = {'comment': '油井措施类别基本信息表'}

    StimType_ID = Column(INTEGER(30),primary_key=True,nullable=False,comment='措施类别ID')
    StimType_Name = Column(String(30),primary_key=True,nullable=False,comment='措施类别')
    Belong_StimType_Name = Column(String(30), comment='隶属措施类别')
    StimType_Rank = Column(String(30),comment='措施类别层级,1--一级分类；2--二级分类；3--三级分类；4--四级分类；5--五级分类。')
    Remark = Column(String(200), comment='备注')


class TbWellbasic(Base):
    __tablename__ = 'tb_wellbasic'
    __table_args__ = {'comment': '油井基本信息表'}

    Well_ID = Column(INTEGER(30),primary_key=True,nullable=False,comment='井号ID')
    Well_Name = Column(String(30),primary_key=True,nullable=False,comment='井号')
    GeoCoordX = Column(Float(30), comment='大地坐标X')
    GeoCoordY = Column(Float(30), comment='大地坐标Y')
    Belong_DvpUnit_Name = Column(String(30), comment='隶属开发单元名称')
    Remark = Column(String(200), comment='备注')


class TbWellprojStimeforcastBpnn(Base):
    __tablename__ = 'tb_wellproj_stimeforcast_bpnn'
    __table_args__ = {'comment': 'BP神经网络预测数据表'}

    Well_Name = Column(String(30), primary_key=True, comment='井号')
    Model_Name = Column(String(30), comment='模型名称')
    StimType_Name = Column(String(30), primary_key=True, comment='措施类别')
    End_Date = Column(String(30), primary_key=True, comment='措施完井日期')
    Term_validity = Column(INTEGER(50), comment='有效期（天）')
    Total_IncreaseOil = Column(Float(255), comment='累计增油量（吨）')
    Sample_Sign = Column(String(255), comment='样本标注：1-样/2-样测/3-测/0-否')
    X1 = Column(Float(30))
    X2 = Column(Float(30))
    X3 = Column(Float(30))
    X4 = Column(Float(30))
    X5 = Column(Float(30))
    X6 = Column(Float(30))
    X7 = Column(Float(30))
    X8 = Column(Float(30))
    X9 = Column(Float(30))
    X10 = Column(Float(30))
    X11 = Column(Float(30))
    X12 = Column(Float(30))
    X13 = Column(Float(30))
    X14 = Column(Float(30))
    X15 = Column(Float(30))
    X16 = Column(Float(30))
    X17 = Column(Float(30))
    X18 = Column(Float(30))
    X19 = Column(Float(30))
    X20 = Column(Float(30))
    X21 = Column(Float(30))
    X22 = Column(Float(30))
    X23 = Column(Float(30))
    X24 = Column(Float(30))
    X25 = Column(Float(30))
    X26 = Column(Float(30))
    X27 = Column(Float(30))
    X28 = Column(Float(30))
    X29 = Column(Float(30))
    X30 = Column(Float(30))



class TbWellprojStimeforcastBpnnModelinfo(Base):
    __tablename__ = 'tb_wellproj_stimeforcast_bpnn_modelinfo'
    __table_args__ = {'comment': 'BP神经网络预测模型信息表'}

    Model_Name = Column(String(50),primary_key=True,nullable=False,comment='模型名称')
    StimType_Name = Column(String(30),primary_key=True,nullable=False,comment='措施类别')
    Creater = Column(String(50), nullable=False, comment='创建者')
    Creat_Time = Column(String(30), nullable=False, comment='创建时间')
    Modify_Time = Column(String(30), comment='修改时间')
    Train_Time = Column(String(30), comment='训练时间')
    Remark = Column(String(30), comment='备注')
    Effect_Paramters_Number = Column(INTEGER(11), comment='效果影响参数数目')
    X1_Paramters_Name = Column(String(30))
    X2_Paramters_Name = Column(String(30))
    X3_Paramters_Name = Column(String(30))
    X4_Paramters_Name = Column(String(30))
    X5_Paramters_Name = Column(String(30))
    X6_Paramters_Name = Column(String(30))
    X7_Paramters_Name = Column(String(30))
    X8_Paramters_Name = Column(String(30))
    X9_Paramters_Name = Column(String(30))
    X10_Paramters_Name = Column(String(30))
    X11_Paramters_Name = Column(String(30))
    X12_Paramters_Name = Column(String(30))
    X13_Paramters_Name = Column(String(30))
    X14_Paramters_Name = Column(String(30))
    X15_Paramters_Name = Column(String(30))
    X16_Paramters_Name = Column(String(30))
    X17_Paramters_Name = Column(String(30))
    X18_Paramters_Name = Column(String(30))
    X19_Paramters_Name = Column(String(30))
    X20_Paramters_Name = Column(String(30))
    X21_Paramters_Name = Column(String(30))
    X22_Paramters_Name = Column(String(30))
    X23_Paramters_Name = Column(String(30))
    X24_Paramters_Name = Column(String(30))
    X25_Paramters_Name = Column(String(30))
    X26_Paramters_Name = Column(String(30))
    X27_Paramters_Name = Column(String(30))
    X28_Paramters_Name = Column(String(30))
    X29_Paramters_Name = Column(String(30))
    X30_Paramters_Name = Column(String(30))
    X1_Paramters_Unit = Column(String(30))
    X2_Paramters_Unit = Column(String(30))
    X3_Paramters_Unit = Column(String(30))
    X4_Paramters_Unit = Column(String(30))
    X5_Paramters_Unit = Column(String(30))
    X6_Paramters_Unit = Column(String(30))
    X7_Paramters_Unit = Column(String(30))
    X8_Paramters_Unit = Column(String(30))
    X9_Paramters_Unit = Column(String(30))
    X10_Paramters_Unit = Column(String(30))
    X11_Paramters_Unit = Column(String(30))
    X12_Paramters_Unit = Column(String(30))
    X13_Paramters_Unit = Column(String(30))
    X14_Paramters_Unit = Column(String(30))
    X15_Paramters_Unit = Column(String(30))
    X16_Paramters_Unit = Column(String(30))
    X17_Paramters_Unit = Column(String(30))
    X18_Paramters_Unit = Column(String(30))
    X19_Paramters_Unit = Column(String(30))
    X20_Paramters_Unit = Column(String(30))
    X21_Paramters_Unit = Column(String(30))
    X22_Paramters_Unit = Column(String(30))
    X23_Paramters_Unit = Column(String(30))
    X24_Paramters_Unit = Column(String(30))
    X25_Paramters_Unit = Column(String(30))
    X26_Paramters_Unit = Column(String(30))
    X27_Paramters_Unit = Column(String(30))
    X28_Paramters_Unit = Column(String(30))
    X29_Paramters_Unit = Column(String(30))
    X30_Paramters_Unit = Column(String(30))




class TbWellprojStimeforcastBpnnPara(Base):
    __tablename__ = 'tb_wellproj_stimeforcast_bpnn_paras'
    __table_args__ = {'comment': 'BP神经网络模型参数表'}

    Model_Name = Column(String(30),primary_key=True,nullable=False,comment='模型名称')
    DvpUnit_ID = Column(String(30),primary_key=True,nullable=False,comment='开发单元id')
    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元名称')
    Stimulate_Date = Column(String(30), comment='完井日期')
    Sample_Num = Column(INTEGER(30), comment='样本总数')
    Train_Num = Column(INTEGER(30), comment='参与训练样本数')
    Test_Num = Column(INTEGER(30), comment='参与测试评价样本数')
    Input_Para = Column(Text(),comment='输入参数名称、计量单位、最大值、最小值；样本统计最大值、最小值、均方差、P10值、P90值')
    Output_Para = Column(Text(),comment='输出参数名称、计量单位、最大值、最小值；样本统计最大值、最小值、均方差、P10值、P90值')
    HideLayer_CoreNum = Column(INTEGER(30), comment='隐藏层神经元数')
    HideLayer_Active = Column(String(30), comment='隐藏层激活函数类型')
    OutputLayer_Active = Column(String(30), comment='输出层激活函数类型')
    Learn_Rate = Column(Float(30), comment='学习率')
    Target_error = Column(Float(30), comment='目标误差')
    MaxEpoch = Column(INTEGER(100), comment='最大迭代次数')
    Model_Paras = Column(Text(), comment=' 训练模型参数')
    Compared_Result = Column(Text(), comment='测试样本模型预测结果及实际值的对比误差值')
    Real_Epoch = Column(INTEGER(100), comment='实际迭代次数')
    Epoch_Error = Column(Float(30), comment='实际迭代最终误差')
    Epoch_Duration = Column(Float(30), comment='实际迭代时长')
    Absolute_ErrorValidity = Column(Float(30), comment='有效期绝对误差')
    Relative_Error_Validity = Column(Float(30), comment='有效期相对误差')
    Cum_OilIncreAbsoluteError = Column(Float(30), comment='累计增油绝对误差')
    Cum_OilIncreRelativeError = Column(Float(30), comment='累计增油相对误差')


class TbOilwellFracResultForcastBpnnPlanprojDatum(Base):
    __tablename__ = 'tb_oilwell_frac_result_forcast_bpnn_planproj_data'

    DvpUnit_OilStim_PlanProj_Name = Column(String(50), primary_key=True, nullable=False, comment='规划方案')
    Well_Name = Column(String(30),primary_key=True,nullable=False,comment='井号')
    Year = Column(String(10), primary_key=True, nullable=False, comment='规划年度')
    X1 = Column(Float(30))
    X2 = Column(Float(30))
    X3 = Column(Float(30))
    X4 = Column(Float(30))
    X5 = Column(Float(30))
    X6 = Column(Float(30))
    X7 = Column(Float(30))
    X8 = Column(Float(30))
    X9 = Column(Float(30))
    X10 = Column(Float(30))
    X11 = Column(Float(30))
    X12 = Column(Float(30))
    X13 = Column(Float(30))
    X14 = Column(Float(30))
    X15 = Column(Float(30))
    X16 = Column(Float(30))
    X17 = Column(Float(30))
    X18 = Column(Float(30))
    X19 = Column(Float(30))
    X20 = Column(Float(30))
    X21 = Column(Float(30))
    X22 = Column(Float(30))
    X23 = Column(Float(30))
    X24 = Column(Float(30))
    X25 = Column(Float(30))
    X26 = Column(Float(30))
    X27 = Column(Float(30))
    X28 = Column(Float(30))
    X29 = Column(Float(30))
    X30 = Column(Float(30))
    ValidPeriod_Forecast = Column(String(50), comment='预测有效期')
    IncreOil_Forecast = Column(String(50), comment='预测累积增油')
    BP_Model_Name = Column(String(50), comment='BP模型名称')
    Stim_Frac_Forecast_Date = Column(String(20), comment='预测时间')


class TbWellprojStimeforcastBpnnPred(Base):
    __tablename__ = 'tb_wellproj_stimeforcast_bpnn_pred'

    DvpUnit_OilStim_PlanProj_Name = Column(String(50), primary_key=True, nullable=False, comment='规划方案')
    Well_Name = Column(String(30),primary_key=True,nullable=False,comment='井号')
    Year = Column(String(10), primary_key=True, nullable=False, comment='规划年度')
    X1 = Column(Float(30))
    X2 = Column(Float(30))
    X3 = Column(Float(30))
    X4 = Column(Float(30))
    X5 = Column(Float(30))
    X6 = Column(Float(30))
    X7 = Column(Float(30))
    X8 = Column(Float(30))
    X9 = Column(Float(30))
    X10 = Column(Float(30))
    X11 = Column(Float(30))
    X12 = Column(Float(30))
    X13 = Column(Float(30))
    X14 = Column(Float(30))
    X15 = Column(Float(30))
    X16 = Column(Float(30))
    X17 = Column(Float(30))
    X18 = Column(Float(30))
    X19 = Column(Float(30))
    X20 = Column(Float(30))
    X21 = Column(Float(30))
    X22 = Column(Float(30))
    X23 = Column(Float(30))
    X24 = Column(Float(30))
    X25 = Column(Float(30))
    X26 = Column(Float(30))
    X27 = Column(Float(30))
    X28 = Column(Float(30))
    X29 = Column(Float(30))
    X30 = Column(Float(30))



class TbYearDvpunitPlanprojOilprice(Base):
    __tablename__ = 'tb_year_dvpunit_planproj_oilprice'
    __table_args__ = {'comment': '开发单元油井措施方案原油价格表'}

    DvpUnit_OilStimulate_PlanProj_Name = Column(String(30), primary_key=True, nullable=False, comment='规划方案')
    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Year = Column(String(10), primary_key=True, nullable=False, comment='规划年度')
    Oil_CommodityRatio = Column(Float(20, True), comment='原油商品率')
    Oil_Price = Column(Float(20, True), comment='原油价格')
    Remark = Column(String(200), comment='备注')


class TbYearDvpunitPlanprojOilprodcost(Base):
    __tablename__ = 'tb_year_dvpunit_planproj_oilprodcost'
    __table_args__ = {'comment': '开发单元油井措施方案原油操作成本表'}

    DvpUnit_OilStim_PlanProj_Name = Column(String(30), primary_key=True, nullable=False, comment='规划方案')
    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Year = Column(String(10), primary_key=True, nullable=False, comment='规划年度')
    Oil_OprCost = Column(Float(20, True), comment='原油操作成本')
    FuelCost = Column(Float(20, True), comment='燃料费')
    Power_Cost = Column(Float(20, True), comment='动力费')
    FluidDispose_Cost = Column(Float(20, True), comment='油气水处理费')
    OilDisplaceAgent_Cost = Column(Float(20, True), comment='驱油物注入费')
    NGLRecovery_Cost = Column(Float(20, True), comment='轻烃回收费')
    Transp_Cost = Column(Float(20, True), comment='运输费')
    WellTest_Cost = Column(Float(20, True), comment='测井试井费')
    Other_Cost = Column(Float(20, True), comment='其它直接费用')
    Depreciation_Cost = Column(Float(20, True), comment='折旧费用')
    Remark = Column(String(200), comment='备注')


class TbYearDvpunitDiscount(Base):
    __tablename__ = 'tb_year_dvpunit_discount'
    __table_args__ = {'comment': '开发单元年度核算资金折现率表'}

    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Year = Column(String(10), primary_key=True, nullable=False, comment='年度')
    Money_Discount = Column(Float(20, True), comment='资金贴现率')
    Remark = Column(String(200), comment='备注')


class TbYearDvpunitOilprice(Base):
    __tablename__ = 'tb_year_dvpunit_oilprice'
    __table_args__ = {'comment': '开发单元年度原油价格表'}

    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Year = Column(String(10), primary_key=True, nullable=False, comment='年度')
    Oil_CommodityRatio = Column(Float(30, True), comment='原油商品率')
    Oil_Price = Column(Float(30, True), comment='原油价格')
    Remark = Column(String(200), comment='备注')


class TbYearDvpunitOilprodcost(Base):
    __tablename__ = 'tb_year_dvpunit_oilprodcost'
    __table_args__ = {'comment': '开发单元年度原油操作成本表'}

    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Year = Column(String(10), primary_key=True, nullable=False, comment='年度')
    Oil_OprCost = Column(Float(20, True), comment='原油操作成本')
    FuelCost = Column(Float(20, True), comment='燃料费')
    Power_Cost = Column(Float(20, True), comment='动力费')
    FluidDispose_Cost = Column(Float(20, True), comment='油气水处理费')
    OilDisplaceAgent_Cost = Column(Float(20, True), comment='驱油物注入费')
    NGLRecovery_Cost = Column(Float(20, True), comment='轻烃回收费')
    Transp_Cost = Column(Float(20, True), comment='运输费')
    WellTest_Cost = Column(Float(20, True), comment='测井试井费')
    Other_Cost = Column(Float(20, True), comment='其它直接费用')
    Depre_Cost = Column(Float(20, True), comment='折旧费用')
    Remark = Column(String(255), comment='备注')


class TbYearDvpunitOilsalecostRatio(Base):
    __tablename__ = 'tb_year_dvpunit_oilsalecost_ratio'
    __table_args__ = {'comment': '开发单元年度原油销售税费率表'}

    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Year = Column(String(10), primary_key=True, nullable=False, comment='年度')
    OilSale_TotalTaxRatio = Column(Float(30, True), comment='原油销售总费率%')
    AddedValue_TaxRatio = Column(Float(30, True), comment='增值税率%')
    Resource_TaxRatio = Column(Float(30, True), comment='资源税率%')
    EduAdd_TaxRatio = Column(Float(30, True), comment='教育附加税率%')
    CityDvpAdd_TaxRate = Column(Float(30, True), comment='城市维护建设税率%')
    Income_TaxRate = Column(Float(30, True), comment='所得税率%')
    ManageCost_Ratio = Column(Float(30, True), comment='管理费率%')
    Remark = Column(String(200), comment='备注')


class TbYearDvpunitOilstimCost(Base):
    __tablename__ = 'tb_year_dvpunit_oilstim_cost'
    __table_args__ = {'comment': '开发单元年度油井措施费用表'}

    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Year = Column(String(30), primary_key=True, nullable=False, comment='年度')
    StimType_Name = Column(String(30),primary_key=True,nullable=False,comment='措施类别')
    Stim_Cost = Column(Float(30, True), comment='作业费用（元/井次）')
    Remark = Column(String(200), comment='备注')


class TbYearDvpunitOilstimPlanprojEvaluateResult(Base):
    __tablename__ = 'tb_year_dvpunit_oilstim_planproj_evaluate_result'
    __table_args__ = {'comment': '开发单元油井措施方案经济评价结果表'}

    DvpUnit_OilStim_PlanProj_Name = Column(String(30), primary_key=True, nullable=False, comment='规划方案')
    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Year = Column(String(10), primary_key=True, nullable=False, comment='规划年度')
    StimType_Name = Column(String(30),primary_key=True,nullable=False,comment='措施类别')
    Stim_WellValidRatio = Column(INTEGER(11), comment='有效率')
    Stim_WellNumber_Valid = Column(INTEGER(11), comment='有效井次')
    Stim_ValidPeriod_Average = Column(INTEGER(11), comment='平均有效期')
    Stim_IncreOil_Average = Column(Float(20, True), comment='平均增油量')
    StimOil_CommodityRatio = Column(Float(20, True), comment='原油商品率')
    Oil_Price = Column(Float(20, True), comment='原油价格')
    OilSale_TotalTaxRatio = Column(Float(20, True), comment='销售税费率')
    Money_Discount = Column(Float(20, True), comment='资金贴现率')
    Oil_OprCost = Column(Float(20, True), comment='操作吨油成本')
    StimCost_Average = Column(Float(20, True), comment='平均作业成本')
    StimOil_WellOprCost_Average = Column(Float(20, True), comment='平均增油操作成本')
    StimOil_Total_Tax_Average = Column(Float(20, True), comment='平均销售总税费')
    StimOil_Gross_SalesIncome_Average = Column(Float(20, True), comment='平均销售毛收入')
    StimOil_Static_Gains_Average = Column(Float(20, True), comment='平均静态收益')
    StimOil_NPV_Average = Column(Float(20, True), comment='平均财务净现值')
    StimOil_ROI = Column(Float(20, True), comment='投资利润率')
    StimOil_NPVR = Column(Float(20, True), comment='财务净现值率')
    StimOil_FIRR = Column(Float(20, True), comment='财务内部收益率')
    Stim_IncreOil_Critical_Average = Column(Float(20, True), comment='平均临界增油量')
    StimOil_Price_Critical = Column(Float(20, True), comment='增油经济临界油价')
    Remark = Column(String(200), comment='备注')


class TbYearDvpunitOilstimPlanprojForecast(Base):
    __tablename__ = 'tb_year_dvpunit_oilstim_planproj_forecast'
    __table_args__ = {'comment': '开发单元油井措施方案效果预测表'}

    DvpUnit_OilStim_PlanProj_Name = Column(String(30), primary_key=True, nullable=False, comment='规划方案')
    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Year = Column(String(10), primary_key=True, nullable=False, comment='规划年度')
    StimType_Name = Column(String(30),primary_key=True,nullable=False,comment='措施类别')
    Forecast_Method = Column(String(100), comment='预测方法')
    Stim_WellValidRatio = Column(INTEGER(11), comment='有效率')
    Stim_WellNumber_Valid = Column(INTEGER(11), comment='有效井次')
    Stim_ValidPeriod_Average = Column(INTEGER(11), comment='平均有效期')
    Stim_IncreOil_Average = Column(Float(20, True), comment='平均增油量')
    Update_Date = Column(DateTime, comment='更新时间')
    Remark = Column(String(200), comment='备注')


class TbYearDvpunitOilstimPlanprojMessage(Base):
    __tablename__ = 'tb_year_dvpunit_oilstim_planproj_basic'
    __table_args__ = {'comment': '开发单元油井措施方案信息表'}

    DvpUnit_OilStim_PlanProj_ID = Column(String(30),primary_key=True,nullable=False,comment='规划方案ID')
    DvpUnit_OilStim_PlanProj_Name = Column(String(50), primary_key=True, nullable=False, comment='规划方案')
    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    StimPlanProj_StartYear = Column(String(10), comment='起始年')
    StimPlanProj_EndYear = Column(String(10), comment='截止年')
    StimPlanProj_Outline = Column(String(500), comment='规划方案简述')
    Create_User_Name = Column(String(30), comment='创建用户')
    Create_Date = Column(Date, comment='创建时间')
    Update_Date = Column(Date, comment='更新时间')
    Remark = Column(String(200), comment='备注')


class TbYearDvpunitOilstimResult(Base):
    __tablename__ = 'tb_year_dvpunit_oilstim_result'
    __table_args__ = {'comment': '开发单元年度油井措施效果记录表'}

    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Year = Column(String(10), primary_key=True, nullable=False, comment='年度')
    StimType_Name = Column(String(30),primary_key=True,nullable=False,comment='措施类别')
    Stim_WellNumber_Valid = Column(INTEGER(11), comment='有效井次')
    Stim_WellValidRatio = Column(Float(10, True), comment='有效率')
    Stim_ValidPeriod_Average = Column(INTEGER(11), comment='平均有效期')
    Stim_IncreOil_Average = Column(Float(30, True), comment='平均累计增油量')
    Remark = Column(String(200), comment='备注')


class TbYearDvpunitOilstimulateEvaluateResult(Base):
    __tablename__ = 'tb_year_dvpunit_oilstimulate_evaluate_result'
    __table_args__ = {'comment': '开发单元年度油井措施经济评价结果表'}

    DvpUnit_Name = Column(String(30), primary_key=True, comment='开发单元')
    Year = Column(String(10), primary_key=True, comment='年度')
    StimType_Name = Column(String(30), comment='措施类别')
    Stim_WellValidRatio = Column(Float(30, True), comment='有效率')
    Stim_WellNumber_Valid = Column(INTEGER(20), comment='有效井次')
    Stim_ValidPeriod_Average = Column(INTEGER(20), comment='平均有效期')
    Stim_IncreOil_Average = Column(Float(50, True), comment='平均累计增油量')
    StimCost_Average = Column(Float(50, True), comment='作业成本')
    StimOil_OprCost_Average = Column(Float(50, True), comment='平均增油操作成本')
    StimOil_CommodityRatio = Column(Float(50, True), comment='原油商品率')
    StimOil_Gross_SalesIncome_Average = Column(Float(50, True), comment='平均销售毛收入')
    StimOil_Total_TaxRatio_Average = Column(Float(50, True), comment='平均销售税费')
    StimOil_Static_Gains_Average = Column(Float(50, True), comment='平均静态收益')
    StimOil_NPV_Average = Column(Float(50, True), comment='平均财务净现值')
    StimOil_ROI = Column(Float(50, True), comment='投资利润率')
    StimOil_NPVR = Column(Float(50, True), comment='财务净现值率')
    StimOil_FIRR = Column(Float(50, True), comment='财务内部收益率')
    Stim_IncreOil_Critical_Average = Column(Float(50, True), comment='平均临界增油量')
    StimOil_Price_Critical_Average = Column(Float(50, True), comment='平均增油经济临界油价')
    Remark = Column(String(200), comment='备注')
    Oil_Price = Column(Float(50, True), comment='原油价格')
    OilSale_TotalTaxRatio = Column(Float(50, True), comment='消费税费率')
    Money_Discount = Column(Float(50, True), comment='资金贴现率')
    Oil_OprCost = Column(Float(50, True), comment='操作吨油成本')
    StimOil_Price_Critical = Column(Float(50, True), comment='增油经济临界油价')
    StimOil_WellOprCost_Average = Column(Float(50, True), comment='平均增油操作成本')


class TbYearDvpunitOilstimulateEvaluateResultCopy1(Base):
    __tablename__ = 'tb_year_dvpunit_oilstimulate_evaluate_result_copy1'
    __table_args__ = {'comment': '开发单元年度油井措施经济评价结果表'}

    DvpUnit_Name = Column(String(30), primary_key=True, comment='开发单元')
    Year = Column(String(10), comment='年度')
    StimType_Name = Column(String(30), comment='措施类别')
    Stim_WellValidRatio = Column(Float(30, True), comment='有效率')
    Stim_WellNumber_Valid = Column(INTEGER(20), comment='有效井次')
    Stim_ValidPeriod_Average = Column(INTEGER(20), comment='平均有效期')
    Stim_IncreOil_Average = Column(Float(50, True), comment='平均累计增油量')
    StimCost_Average = Column(Float(50, True), comment='平均作业成本')
    StimOil_OprCost_Average = Column(Float(50, True), comment='平均增油操作成本')
    StimOil_CommodityRatio = Column(Float(50, True), comment='原油商品率')
    StimOil_Gross_SalesIncome_Average = Column(Float(50, True), comment='平均销售毛收入')
    StimOil_Total_TaxRatio_Average = Column(Float(50, True), comment='平均销售税费')
    StimOil_Static_Gains_Average = Column(Float(50, True), comment='平均静态收益')
    StimOil_NPV_Average = Column(Float(50, True), comment='平均财务净现值')
    StimOil_ROI = Column(Float(50, True), comment='投资利润率')
    StimOil_NPVR = Column(Float(50, True), comment='财务净现值率')
    StimOil_FIRR = Column(Float(50, True), comment='财务内部收益率')
    Stim_IncreOil_Critical_Average = Column(Float(50, True), comment='平均临界增油量')
    StimOil_Price_Critical_Average = Column(Float(50, True), comment='平均增油经济临界油价')
    Remark = Column(String(200), comment='备注')
    Oil_Price = Column(Float(50, True), comment='原油价格')
    OilSale_TotalTaxRatio = Column(Float(50, True), comment='消费税费率')
    Money_Discount = Column(Float(50, True), comment='资金贴现率')
    Oil_OprCost = Column(Float(50, True), comment='操作吨油成本')
    StimOil_Price_Critical = Column(Float(50, True), comment='增油经济临界油价')
    StimOil_WellOprCost_Average = Column(Float(50, True), comment='平均增油操作成本')


class TbYearDvpunitPlanprojDiscount(Base):
    __tablename__ = 'tb_year_dvpunit_planproj_discount'
    __table_args__ = {'comment': '开发单元油井措施方案核算资金折现率表'}

    DvpUnit_OilStimulate_PlanProj_Name = Column(String(30), primary_key=True, nullable=False, comment='规划方案')
    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Year = Column(String(10), primary_key=True, nullable=False, comment='规划年度')
    Money_Discount = Column(Float(10, True), comment='资金贴现率')
    Remark = Column(String(200), comment='备注')


class TbYearDvpunitPlanprojOilsalecostRatio(Base):
    __tablename__ = 'tb_year_dvpunit_planproj_oilsalecost_ratio'
    __table_args__ = {'comment': '开发单元油井措施方案原油销售税费率表'}

    DvpUnit_OilStim_PlanProj_Name = Column(String(30), primary_key=True, nullable=False, comment='规划方案')
    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Year = Column(String(10), primary_key=True, nullable=False, comment='规划年度')
    OilSale_TotalTaxRatio = Column(Float(20, True), comment='原油销售总费率')
    AddedValue_TaxRatio = Column(Float(20, True), comment='增值税率')
    Resource_TaxRatio = Column(Float(20, True), comment='资源税率')
    EduAdd_TaxRatio = Column(Float(20, True), comment='教育附加税率')
    CityDvpAdd_TaxRate = Column(Float(20, True), comment='城市维护建设税率')
    Income_TaxRate = Column(Float(20, True), comment='所得税率')
    ManageCost_Ratio = Column(Float(20, True), comment='管理费率')
    Remark = Column(String(200), comment='备注')


class TbYearDvpunitPlanprojOilsalecostRatioCopy1(Base):
    __tablename__ = 'tb_year_dvpunit_planproj_oilsalecost_ratio_copy1'
    __table_args__ = {'comment': '开发单元油井措施方案原油销售税费率表'}

    DvpUnit_OilStim_PlanProj_Name = Column(String(30), primary_key=True, nullable=False, comment='规划方案')
    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Year = Column(String(10), primary_key=True, nullable=False, comment='规划年度')
    OilSale_TotalTaxRatio = Column(Float(20, True), comment='原油销售总费率')
    AddedValue_TaxRatio = Column(Float(20, True), comment='增值税率')
    Resource_TaxRatio = Column(Float(20, True), comment='资源税率')
    EduAdd_TaxRatio = Column(Float(20, True), comment='教育附加税率')
    CityDvpAdd_TaxRate = Column(Float(20, True), comment='城市维护建设税率')
    Income_TaxRate = Column(Float(20, True), comment='所得税率')
    ManageCost_Ratio = Column(Float(20, True), comment='管理费率')
    Remark = Column(String(200), comment='备注')


class TbYearDvpunitPlanprojOilstimCost(Base):
    __tablename__ = 'tb_year_dvpunit_planproj_oilstim_cost'
    __table_args__ = {'comment': '开发单元油井措施方案作业费用表'}

    DvpUnit_OilStim_PlanProj_Name = Column(String(30), primary_key=True, nullable=False, comment='规划方案')
    DvpUnit_Name = Column(String(30),primary_key=True,nullable=False,comment='开发单元')
    Year = Column(String(10), primary_key=True, nullable=False, comment='规划年度')
    StimType_Name = Column(String(30),primary_key=True,nullable=False,comment='措施类别')
    Stim_Cost = Column(Float(20, True), comment='预测作业费用')
    Remark = Column(String(200), comment='备注')


class TbYearProfitLossAn(Base):
    __tablename__ = 'tb_year_profit_loss_ans'

    user_id = Column(String(200), primary_key=True, nullable=False)
    project_id = Column(String(200), primary_key=True, nullable=False)
    dvpUnit_Name = Column(String(200))
    stimType_Name = Column(String(200))
    year = Column(INTEGER(200))
    calcu_type = Column(String(200))
    OilPriceCritical = Column(Float(255))
    IncreOilCritical = Column(Float(255))
    StimCostCritical = Column(Float(255))
    analysis_data = Column(String(255))
    parm_set_data = Column(String(255))
    Stim_WellNumber_Valid = Column(INTEGER(11), comment='有效井次')
    Stim_WellValidRatio = Column(Float(50), comment='有效率')
    Stim_ValidPeriod_Average = Column(INTEGER(11), comment='平均有效期')
    Stim_IncreOil_Average = Column(Float(255), comment='平均累计增油量')
    StimOil_CommodityRatio = Column(Float(50), comment='原油商品率')
    Oil_Price = Column(Float(50), comment='原油价格')
    OilSale_TotalTaxRatio = Column(Float(50), comment='销售税费率')
    Money_Discount = Column(Float(50), comment='资金贴现率')
    Oil_OprCost = Column(Float(50), comment='操作吨油成本')
    StimCost_Average = Column(Float(50), comment='平均作业成本')


class TbPageRecovery(Base):
    __tablename__ = 'tb_page_recovery'

    UserID = Column(String(200), primary_key=True, nullable=False)
    ProJID = Column(String(200), primary_key=True, nullable=False)
    Tab1 = Column(Text())
    Tab2 = Column(Text())
    Tab3 = Column(Text())